<style>
.image_tabs div{
	display:inline-block;
	padding:6px;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
.search_btn{
	float:right;
	margin:0;
	padding:0!important;
	position:relative;
}
.search_btn input{
	margin:0;
}
.search_btn button{
	position:absolute;
	top:0;
	bottom:0;
	right:0;
	margin:0;
	padding:0 12px;
	border-radius:0 4px 4px 0;
}
.image_content{
	height:300px;
	overflow-y:auto;
	font-size:0;
	padding:10px 3px;
	margin:10px 0;
}
.img{
	width:18%;
	display:inline-block;
	text-align:center;
	position:relative;
	height:120px;
	border:1px solid #ccc;
	margin:1%;
}
.img:before{
	content:"";
	height:100%;
	display:inline-block;
	vertical-align:middle;
}
.img img{
	max-width:99%;
	max-height:100%;
	display:inline-block;
	vertical-align:middle;
}
.apply_btn{
	padding-top:20px;
	text-align:right;
}
.img_selected{
	border-color:green;
}
</style>

<div style="width:650px;">
	<div class="image_tabs">
		<div class="image_tab" [ngClass]="{active:tab==''}">图片库</div>
		<div class="image_tab" [ngClass]="{active:tab==''}">上传图片</div>
		<div class="search_btn">
			<input type="text" [(ngModel)]="keyWord"/>
			<button [disabled]="!keyWord" (click)="search();">搜索</button>
		</div>
	</div>
	<div>
		<div class="image_content">
			<div class="img" *ngFor="let img of images" (click)="select(img);" [ngClass]="{img_selected:selectedImg==img}">
				<img src="{{img.img_small}}" title="{{img.name}}" alt="{{img.name}}" />
			</div>
		</div>
		<div class="apply_btn">
			<button [disabled]="!selectedImg" (click)="apply();">确定使用</button>
		</div>
	</div>
</div>